import Main from '@/pages/Main'

//登录页路由
const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: '登录'
    },
    component: resolve => { require(['@/pages/Login.vue'], resolve); }
};

// 主路由
const appRouter = [
    // 首页
    {
		path: '',
		name: 'main',
		title: '首页',
		redirect: 'home',
		component: Main,
		children: [
			{ path: 'home', title: '工作台', name: 'home', meta: { requireAuth: true }, component: () => import('@/pages/Home.vue') }
		]
    },
    // 问卷管理
    {
		path: '/questionnaire',
	    name: 'questionnaire',
	    title: '问卷管理',
	    redirect: '/questionnaire/coinList',
	    component: Main,
	    children: [
	        { path: 'coinList', title: '数币信息', name: 'coinList', meta: { requireAuth: true }, component: () => import('@/pages/CoinList.vue') },
	        { path: 'commentList', title: '评论列表', name: 'commentList', meta: { requireAuth: true }, component: () => import('@/pages/CommentList.vue') }
	    ]
    },
    // 调研管理
    {
        path: '/investigation',
   		name: 'investigation',
   		title: '调研管理',
   		redirect: '/investigation/requestList',
   		component: Main,
   		children: [
   			{ path: 'requestList', title: '请求列表', name: 'requestList', meta: { requireAuth: true }, component: () => import('@/pages/InvestigationRequestList.vue') },
   			{ path: 'questionnaireList', title: '问卷列表', name: 'questionnaireList', meta: { requireAuth: true }, component: () => import('@/pages/QuestionnaireList.vue') },
   			{ path: 'completedList/:id', title: '已完成列表', name: 'completedList', meta: { requireAuth: true }, component: () => import('@/pages/CompletedList.vue') },
   			{ path: 'completedDetail/:uuid', title: '查看详情', name: 'completedDetail', meta: { requireAuth: true }, component: () => import('@/pages/CompletedDetail.vue') },
   			{ path: 'questionShow/:uid', title: '查看问题', name: 'questionShow', meta: { requireAuth: true }, component: () => import('@/pages/QuestionShow.vue') },
   			{ path: 'communityRating', title: '社区评级', name: 'communityRating', meta: { requireAuth: true }, component: () => import('@/pages/CommunityRating.vue') },
   			{ path: 'reportList', title: '报告列表', name: 'reportList', meta: { requireAuth: true }, component: () => import('@/pages/ReportList.vue') }
   		]
    },
    // 模型管理
    // {

    // },
    // 付费管理
    // {

    // }
    
];

export const routers = [
	loginRouter,
	...appRouter,
]
